package com.kzx.filter;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

public class Filter2 implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("Filter2 init()初始化。。。");

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("Filter2 doFilter chain调用前。。。"+ ((HttpServletRequest)servletRequest).getRequestURL().toString());
        filterChain.doFilter(servletRequest, servletResponse);
        System.out.println("Filter2 doFilter chain调用后。。。"+ ((HttpServletRequest)servletRequest).getRequestURL().toString());

    }

    @Override
    public void destroy() {
        System.out.println("Filter2 destroy()销毁。。。");

    }
}
